<template>
  <div class="new-sletter">
    <div>
      <p class="title">Newsletter</p>
      <input
        @focus="isShow = true"
        v-model="info.text"
        type="text"
        placeholder="Enter your email here..."
      />
      <p v-show="inputTips" class="tips">This is a required field.</p>
      <div v-show="isShow">
        <div class="content-box">
          <div class="left-box">
            <el-checkbox v-model="info.checked"></el-checkbox>
          </div>
          <div class="right-box">
            {{ text }}
          </div>
        </div>
        <p v-show="checkTips" class="tips">This is a required field</p>
        <button @click="submit">Subscribe</button>
        <p>
          This site is protected by reCAPTCHA and the Google Privacy Policy and
          <strong>Terms of Service</strong> apply
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  props: [""],
  data() {
    return {
      inputTips: false,
      checkTips: false,
      isShow: false,
      info: {
        text: "",
        checked: false
      },
      text:
        "I have read and accept the privacy policy, and I wish to receive the newsletter of SVD with info about exclusive products and releases.*"
    };
  },

  components: {},

  computed: {},

  beforeMount() {},

  mounted() {},

  methods: {
    submit() {
      if (!this.info.text) {
        this.inputTips = true;
      } else {
        this.inputTips = false;
      }
      if (!this.info.checked) {
        this.checkTips = true;
      } else {
        this.checkTips = false;
      }
    }
  },

  watch: {}
};
</script>
<style lang="scss" scoped>
.new-sletter {
	display: flex;
	align-items: center;
	min-height: 257px;
	& > div {
		width: 100%;
	}
  p.title {
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 500;
		text-align: center;
		margin-bottom: 20px;
  }
  input {
    width: 100%;
    height: 30px;
    line-height: 30px;
    border: 0;
    border-bottom: 1px solid #e2e2e2;
    outline: none;
    border-radius: unset;
    font-size: 14px;
		color: #000;
		margin-bottom: 5px;
  }
  p.tips {
		margin: 0;
    color: #e02b27;
    font-size: 12px;
  }
  .content-box {
		display: flex;
		margin-bottom: 10px;
		margin-top: 10px;
    .right-box {
      margin-left: 15px;
      font-size: 14px;
      font-weight: 100;
      cursor: pointer;
    }
  }
  button {
    width: 166px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    color: #fff;
    background-color: #000;
    border: none;
    outline: none;
    font-weight: 700;
		cursor: pointer;
		margin-top: 10px;
  }
  p:last-child {
    margin-top: 5px;
    margin-bottom: 30px;
    color: #969696;
    font-size: 12px;
    line-height: 18px;
    & > strong {
      color: #1a1a1a;
      font-weight: normal;
      cursor: pointer;
    }
  }
}
</style>
